/**
 * Copyright (c) 2011-2014, James Zhan 詹波 (jfinal@126.com).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */

package com.jfinal.weixin.sdk.api;


import com.jfinal.kit.HttpKit;

/**
 * 用户管理 API
 * https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN
 */
public class GroupApi {
	//查询所有分组
	private static String getGroups = "https://api.weixin.qq.com/cgi-bin/groups/get?access_token=";
	//查询用户所在分组
	private static String getUserGroup = "https://api.weixin.qq.com/cgi-bin/groups/getid?access_token=";

	private static String deleteMenu = "https://api.weixin.qq.com/cgi-bin/menu/delete?access_token=";
	public static ApiResult getGroups() {
		String jsonResult = HttpKit.get(getGroups + AccessTokenApi.getAccessToken().getAccessToken());
		return new ApiResult(jsonResult);
	}

	public static ApiResult getUserGroup(String jsonStr) {
		String jsonResult = HttpKit.post(getUserGroup + AccessTokenApi.getAccessToken().getAccessToken(), jsonStr);
		return new ApiResult(jsonResult);
	}

}
